// @ts-ignore
/* eslint-disable */
import request from "@/util/request.ts";

/** 此处后端没有提供注释 POST /bookCategory/add */
export async function addBookCategory(
  body: API.AddBookCategoryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong>("/bookCategory/add", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 DELETE /bookCategory/delete/${param0} */
export async function deleteBookCategory(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteBookCategoryParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/bookCategory/delete/${param0}`, {
    method: "DELETE",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /bookCategory/get/${param0} */
export async function getBookCategoryById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getBookCategoryByIdParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBookCategory>(`/bookCategory/get/${param0}`, {
    method: "GET",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /bookCategory/list */
export async function listBookCategories(options?: { [key: string]: any }) {
  return request<API.BaseResponseListBookCategory>("/bookCategory/list", {
    method: "GET",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /bookCategory/update */
export async function updateBookCategory(
  body: API.UpdateBookCategoryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>("/bookCategory/update", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
